﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace MineCraft_Update
{
    internal static class Util
    {
        public static string RunCommandOut(string command)
        {
            var p =
                new Process()
                {
                    StartInfo =
                    new ProcessStartInfo("cmd", "/c " + command)
                    {
                        RedirectStandardOutput = true,
                        UseShellExecute = false,
                        CreateNoWindow = true,
                    }
                };
            p.Start();
            return p.StandardOutput.ReadToEnd();
        }

        public static void RunCommand(string command)
        {
            new System.Diagnostics.Process()
            {
                StartInfo =
                 new ProcessStartInfo("cmd", "/c " + command)
                 {
                     RedirectStandardOutput = true,
                     UseShellExecute = false,
                     CreateNoWindow = true,
                 }
            }.Start();
        }
    }
}
